package com.kitten.count.domain.mapper;

import com.kitten.count.domain.dataobject.NoteCountDO;
import org.apache.ibatis.annotations.Param;

public interface NoteCountDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(NoteCountDO record);

    int insertSelective(NoteCountDO record);

    NoteCountDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(NoteCountDO record);

    int updateByPrimaryKey(NoteCountDO record);

    /**
     * 插入或更新 收藏数据
     * @param noteId
     * @param count
     * @return
     */
    int insertOrUpdateLikeTotalByNoteId(@Param("noteId") Long noteId, @Param("count") Integer count);

    /**
     * 插入或更新 收藏数据
     * @param noteId
     * @param count
     * @return
     */
    int insertOrUpdateCollectTotalByNoteId(@Param("noteId") Long noteId, @Param("count") Integer count);

    /**
     * 插入或更新 笔记评论数
     * @param count
     * @param noteId
     */
    int insertOrUpdateCommentTotalByNoteId(@Param("count") int count, @Param("noteId") Long noteId);
}